package com.example.mobile2121606097wjc0509;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;

public class LoginActivity extends AppCompatActivity {
    private EditText edtTxtLoginUsername;
    private EditText edtTxtLoginPassword;
    private Button btnLoginLogin;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_login);
        initView();
        btnLoginLogin.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(LoginActivity.this,ShowDataActivity2.class);
                intent.putExtra("userName",edtTxtLoginUsername.getText().toString().trim());
                Bundle bundle = new Bundle();
                bundle.putString("passWord",edtTxtLoginPassword.getText().toString().trim());
                intent.putExtras(bundle);
                startActivity(intent);
            }
        });
    }

    private void initView() {
        edtTxtLoginUsername=(EditText) findViewById(R.id.edtTxtLoginUsername);
        edtTxtLoginPassword=(EditText) findViewById(R.id.edtTxtLoginPassword);
        btnLoginLogin=(Button) findViewById(R.id.btnLoginLogin);
    }
}